<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/view/include/taglib.jsp"%>
<html>
<head>
	<title>相册表</title>
	<%@ include file="../../include/head.jsp"%>
</head>
<body>
	<div class="admin-content">
		<div class="admin-content-body">
			<div class="am-g ui-tools">
				<div class="am-u-sm-12 am-u-md-6">
					<div class="am-btn-toolbar">
						<div class="am-btn-group am-btn-group-xs">
							<button type="button" class="am-btn am-btn-default" onclick="openModel('新增相册','${ctx}/cms/album/create?categoryId=${page.entity.categoryId}')">
								<span class="am-icon-plus"></span> 新增
							</button>
						</div>
					</div>
				</div>
				<div class="am-u-sm-12 am-u-md-3">
					<form id="searchForm" action="${ctx}/cms/album/list?categoryId=${page.entity.categoryId}" method="post">
						<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
						<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
						<div class="am-input-group am-input-group-sm">
							<input type="text" class="am-form-field" name="key" value="${page.key}" placeholder=""> <span
								class="am-input-group-btn">
								<button class="am-btn am-btn-default" type="submit">搜索</button>
							</span>
						</div>
					</form>
				</div>
			</div>
			<div class="am-g">
				<div class="am-u-sm-12">
					<form class="am-form">
						<table id="contentTable" class="am-table am-table-striped am-table-hover table-main">
							<thead>
								<tr>
									<th>标题</th>
									<th>图片地址</th>
									<th>更新时间</th>
									<th>备注</th>
                                    <th>操作</th>
								</tr>
							</thead>
							<tbody>
								<c:forEach items="${page.list}" var="album">
									<tr>
                                            <td>${album.title}</td>
                                            <td>${album.image}</td>
                                            <td><fmt:formatDate value="${album.updateDate}"
												pattern="yyyy-MM-dd HH:mm:ss" /></td>
                                            <td>${album.remarks}</td>
										<td>
											<a href="javascript:;" onclick="openModel('修改相册','${ctx}/cms/album/update?id=${album.id}')" title="编辑"><span class="am-icon-pencil"></span></a>
											<a href="${ctx}/cms/album/delete?id=${album.id}&pageNo=${page.pageNo}&pageSize=${page.pageSize}"
											onclick="return confirm('确认要删除该条数据吗？', this.href)" title="删除"><span class="am-text-danger am-icon-trash-o"></span></a></td>
									</tr>
								</c:forEach>
							</tbody>
						</table>
					</form>
					<%@ include file="../../utils/pagination.jsp"%>
				</div>
			</div>
		</div>
	</div>
	<script type="text/javascript">
		$(document).ready(function() {
			var msg = '${msg}';
			if(msg!=''){
				showMsg(msg);
			}
		});
	</script>
</body>
</html>
